HealthWorkoutEvent PRO
The HealthWorkoutEvent class provides an interface for accessing workout-related events in Apple Health data. Each event represents a specific moment or action within a workout session, such as when the workout is paused, resumed, or marked with a lap or milestone.
Use Cases
- Analyzing workout flow: determine when a user paused or resumed a workout.
- Measuring active versus idle workout time.
- Identifying workout laps or marked segments.
- Supporting custom logic in workout summaries or visualizations.
Enum: HealthWorkoutEventType
This enum defines the various types of workout events.
Class: HealthWorkoutEvent
Properties
Note:
HealthDateIntervalcontainsstart,end, andduration(in seconds).
Example
Logging Workout Events
Notes
- Workout events are typically part of a
HealthWorkoutinstance, which includes these events as an array. - You can use these events to reconstruct the full timeline of a workout session and determine user behavior.
- Automatic motion detection (pause/resume) is particularly useful for passive workouts such as walking or cycling.
